
#如果没有赋值，就给这个值
PREFIX ?= ../install 
#PRJNAME = sample
#PRJNAME = logger
PRJNAME = database
#PRJNAME = com_server


CFLAGS  += -I /home/zkf/install/include -I ../include#-I 头文件路径 -L 动态库路径
LDFLAGS += -L ./ -lsqlite3 -L /home/zkf/install/lib -lsrc
RUNFLAGS += -i 127.0.0.1 -p 1234 -s ZKF0001 -t 10

all: shared_lib
	gcc  ${PRJNAME}.c -o ${PRJNAME} ${CFLAGS} ${LDFLAGS}

static_lib:
	gcc -c ${PRJNAME}.c -I /home/zkf/install/include -I ../include
	ar -rcs lib${PRJNAME}.a ${PRJNAME}.o

shared_lib:
	gcc -shared -fPIC com_server.c database.c sample.c logger.c -o libsrc.so -I /home/zkf/install/include -I ../include 

LD_export:
	export LD_LIBRARY_PATH=/home/zkf/project_socket/src/:/home/zkf/install/lib/
	#/src libsrc.so 
	#/lib libsqlite3.so

clean:
	rm -f ${PRJNAME}
	rm -f *.db
	rm -f lib* 
run:
	gcc  ${PRJNAME}.c -o ${PRJNAME} ${CFLAGS} ${LDFLAGS}
